package com.zyh.thread.demo1;

/**
 * @Author zyh
 * @Date 2024/8/8 9:20
 * @Description 线程安全问题
 */

public class ThreadDemo1 {
    public static void main(String[] args) {
        //创建一个账户对象
        Account account = new Account(5000);
        //创建两个任务
        Task01 task01 = new Task01(account);
        Task02 task02 = new Task02(account);
        //创建两个线程
        new Thread(task01,"线程1").start();
        new Thread(task02,"线程2").start();
    }
}
